home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 1.iso
/
ARGONET
/
PD
/
COMMS
/
IRCMACRO.ZIP
/
!IRCMacro
/
!RunImage
(
.txt
)
< prev
next >
Wrap
RISC OS BBC BASIC V Source
|
1996-08-05
|
10KB
|
450 lines
IRC Macro Tool
By Rich Goodwin
" at line ";
Task$="IRCMacro"
"Purpose$="easier IRC chatting"
%Author$=
(169)+" Richard Goodwin"
+Version$="1.00"+
(223)+" (August 1996)"
quit
saveoptions
$(block%)="TASK"
"Wimp_CloseDown",taskhandle,!block%
quit=0
pumping=0
block% 256
menublock% 256
"Wimp_Initialise",200,&4B534154,Task$
,taskhandle
"Wimp_OpenTemplate",,"IRCMacro:Resources.Templates"
"Wimp_LoadTemplate",,,,,,"Info"
,templen,worklen
info templen,infowork worklen
"Wimp_LoadTemplate",,info,infowork,infowork+worklen,-1,"Info",0
"Wimp_LoadTemplate",,,,,,"Effects"
,templen,worklen
effect templen,effectwork worklen
"Wimp_LoadTemplate",,effect,effectwork,effectwork+worklen,-1,"Effects",0
"Wimp_LoadTemplate",,,,,,"Characters"
,templen,worklen
char templen,charwork worklen
"Wimp_LoadTemplate",,char,charwork,charwork+worklen,-1,"Characters",0
"Wimp_LoadTemplate",,,,,,"IRCMacros"
,templen,worklen
ircmacro templen,ircmacrowork worklen
"Wimp_LoadTemplate",,ircmacro,ircmacrowork,ircmacrowork+worklen,-1,"IRCMacros",0
"Wimp_LoadTemplate",,,,,,"Choices"
,templen,worklen
choice templen,choicework worklen
"Wimp_LoadTemplate",,choice,choicework,choicework+worklen,-1,"Choices",0
"Wimp_CloseTemplate"
"Wimp_CreateWindow",,info
infohandle
"Wimp_CreateWindow",,ircmacro
ircmacrohandle
DefineIRCMacros
iconbar
version
defineoptions
IRCMacroOpen=
openircmacro
iconbar
!block%=-1
block%!4=0
block%!8=0
block%!12=68
block%!16=68
block%!20=&201A
$(block%+24)="!IRCMacro"
"Wimp_CreateIcon",,block%
iconbarhandle
version
!block%=infohandle
block%!4=1
"Wimp_GetIconState",,block%
$(block%!28)=Task$
!block%=infohandle
block%!4=2
"Wimp_GetIconState",,block%
$(block%!28)=Purpose$
!block%=infohandle
block%!4=3
"Wimp_GetIconState",,block%
$(block%!28)=Author$
!block%=infohandle
block%!4=4
"Wimp_GetIconState",,block%
$(block%!28)=Version$
makeiconmenu(X)
$(menublock%)=Task$
menublock%!12=&00070207
menublock%!16=182
menublock%!20=44
menublock%!24=0
menublock%!28=2
menublock%!32=infohandle
menublock%!36=&7000001
$(menublock%+40)="Info"
menublock%!52=2
a menublock%!56=ircmacrohandle
menublock%!60=&7000001
$(menublock%+64)="Macros"
menublock%!76=0
menublock%!80=0
menublock%!84=&7000001
$(menublock%+88)="Reload"
menublock%!100=2
menublock%!104=0
menublock%!108=&7000001
$(menublock%+112)="Save"
menublock%!124=&80
menublock%!128=-1
menublock%!132=&7000001
$(menublock%+136)="Quit"
"Wimp_CreateMenu",,menublock%,X,370
openircmacro
!block%=ircmacrohandle
"Wimp_GetWindowState",,block%
block%!28=-1
"Wimp_OpenWindow",,block%
IRCMacroOpen=
"Wimp_Poll",0,block%
reason,handle
reason
1 :
"Wimp_RedrawWindow",,block%
2 :
"Wimp_OpenWindow",,block%
3 :
ClosingWindows
6 :
mouseclick(block%)
9 :
menuselect(block%)
17,18 :
message(block%)
ClosingWindows
handle!0=ircmacrohandle
IRCMacroOpen=
"Wimp_CloseWindow",,block%
mouseclick(bl)
bl!12=-2
oniconbar
bl!12=ircmacrohandle
ClickOnIRCMacro
oniconbar
bl!8=4
bl!16=iconbarhandle
openircmacro
bl!8=1
bl!16=iconbarhandle
"XOS_CLI","Filer_Run <IRCMacroScripts$Dir>.Script"
bl!8=2
bl!16=iconbarhandle
makeiconmenu(!bl-64)
message(bl)
bl!16
0 : quit=-1
3 :
fileinsert
&502:
menuselect(bl)
!bl
"XOS_CLI","Filer_OpenDir IRCMacro:Resources.^"
openircmacro
LoadIRCMacros("<IRCMacroScripts$Dir>.Script"):
RedrawWindows
SaveIRCMacros
4: quit=-1
push(pump$)
pumping=1
(pump$)=0
character=
pump$,X,1))
"OS_Byte",138,0,character
5=0
character=10
character=13
character=32
(pump$)
pumping=0
zero(number%)
number%<=9
number%>=0
="0"
DefineIRCMacros
loop%
ircmacro$(12)
+ircmacro$(02)="/away for a while"+
DoIRCMacroString(1,"Away for a while")
ircmacro$(03)="/away"+
DoIRCMacroString(2,"Away")
0ircmacro$(04)="/me is doing something"+
DoIRCMacroString(3,"I'm doing something")
ircmacro$(05)="Hiya"
DoIRCMacroString(4,"Hiya")
ircmacro$(06)="/topic"
DoIRCMacroString(5,"topic")
ircmacro$(07)="/clear"+
DoIRCMacroString(6,"Clear")
&ircmacro$(08)="/list -Min 5"+
DoIRCMacroString(7,"List 5 minutes")
ircmacro$(09)="/who"+
DoIRCMacroString(8,"Who")
ircmacro$(01)="/help"+
DoIRCMacroString(0,"Help")
4ircmacro$(10)="/quit to do something else"+
DoIRCMacroString(9,"Leave")
DoIRCMacroString(10," ")
ircmacro$(11)=""
DoIRCMacroString(11,"IRCMacro by R. Goodwin")
Bircmacro$(12)="/me is using IRCMacro by Richard Goodwin"+
LoadIRCMacros("<IRCMacroScripts$Dir>.Script")
DoIRCMacroString(icon,string$)
icon>12
(string$)>28 string$=
string$,28)
!block%=ircmacrohandle
block%!4=icon
"Wimp_GetIconState",,block%
$(block%!28)=string$
LoadIRCMacros(inputfile$)
check%, fileopen, char, var$, macro$, ircmacronumber
"OS_File",5,inputfile$
check%
check%=0
fileopen=
inputfile$
var$=""
char=
#fileopen
char>96
char<123
char-=32
char<>
char<>10
char<>13
char<>32
char<>0
(var$)<250
var$=var$+
(char)
char=
#fileopen
#fileopen
#fileopen:
macro$=""
char=
#fileopen
char=92
macro$=macro$+
char<>10
char<>13
char<>
(macro$)<255
macro$=macro$+
(char)
char=10
char=13
#fileopen
ircmacronumber=0
(var$)=8
var$,6)="IRCTAG"
ircmacronumber=(
var$,2))
(var$)=8
var$,6)="IRCDEF"
ircmacronumber=(
var$,2))
(var$)=7
var$,6)="IRCTAG"
ircmacronumber=(
var$,1))
(var$)=7
var$,6)="IRCDEF"
ircmacronumber=(
var$,1))
var$="IRCDEF"
var$="IRCTAG" var$=""
var$,6)="IRCDEF"
ircmacronumber>12 var$=""
var$,6)="IRCTAG"
ircmacronumber>12 var$=""
var$,6)="IRCDEF"
ircmacronumber<1 var$=""
var$,6)="IRCDEF"
ircmacronumber<1 var$=""
var$,6)
"IRCTAG":
DoIRCMacroString(ircmacronumber-1,macro$)
"IRCDEF": ircmacro$(ircmacronumber)=macro$
#fileopen
#fileopen
ClickOnIRCMacro
temp$, icon%
(bl!8
4)=1
IRCMacroOpen=
"Wimp_CloseWindow",,block%
temp$="":icon%=bl!16
icon%>=0
icon%<=11
temp$=ircmacro$(icon%+1)
temp$=""
pumping=0
push(temp$):
pumping=1
(pump$)+
(temp$)>255
pump$=pump$+temp$:
help$
block%!32
-2:help$="This is the "+Task$+" icon.|MIt allows "+Purpose$+".|M"
infohandle:help$=Task$+": Version "+Version$+"|M"+Author$+"|M"
help$<>""
block%!12=block%!8
block%!16=&503
$(block%+20)=help$+
!block%=(25+
help$)
"Wimp_SendMessage",17,block%,block%!4,0
fileinsert
pos%,temp$
name$="":temp$=""
pos%=0
?(bl+44+pos%)<>0
name$+=
(?(bl+44+pos%))
pos%+=1
GetFileType
GetFileInfo
filetype%
&FFF :
LoadNewDefinitions(name$)
temp$=""
pumping=0
push(temp$):
pumping=1
(pump$)+
(temp$)>255
pump$=pump$+temp$:
GetFileType
"OS_File",5,name$
,,filetype%
9&filetype%=(filetype%
&FFF00)>>>8
GetFileInfo
pos%,q$,noextension$
pos%=
(name$):file$=""
name$,pos%,1)
pos%-=1
q$<>"."
file$=q$+file$
q$="."
noextension$="":pos%=0
pos%+=1
file$,pos%,1)
q$<>"/" noextension$+=q$
q$="/"
pos%>=
(file$)
file$=noextension$
defineoptions
IRCMacroOpen=
loadoptions
loadoptions
S+inputfile$="IRCMacro:Resources.Options"
check%, fileopen, char, var$, option$
"OS_File",5,inputfile$
check%
check%=0
fileopen=
inputfile$
var$=""
char=
#fileopen
char>96
char<123
char-=32
char<>
char<>10
char<>13
char<>32
char<>0
var$=var$+
(char)
char=
#fileopen
#fileopen
#fileopen:
option$=""
char=
#fileopen
char>96
char<123
char-=32
char<>10
char<>13
option$=option$+
(char)
char=10
char=13
#fileopen
var$="IRCMACROOPEN"
option$="YES"
IRCMacroOpen=
var$="IRCMACROOPEN"
option$="NO"
IRCMacroOpen=
#fileopen
#fileopen
saveoptions
"XOS_CLI","Delete IRCMacro:Resources.Options"
o+fileopen=
"IRCMacro:Resources.Options"
IRCMacroOpen=
tofile("IRCMacroOpen=Yes")
tofile("IRCMacroOpen=No")
#fileopen
"XOS_CLI","SetType IRCMacro:Resources.Options FFF"
RedrawWindows
"Wimp_ForceRedraw",-1,-1000,-1000,6000,6000
tofile(tofile$)
output
tofile$=""
pos%=1
(tofile$)
output=
tofile$,pos%,1)
output=13
output=10 output=
#fileopen,output
#fileopen,13
LoadNewDefinitions(name$)
LoadIRCMacros(name$)
RedrawWindows
SaveDefs
SaveIRCMacros
SaveIRCMacros
"XOS_CLI","Copy <IRCMacroScripts$Dir>.Script <IRCMacroScripts$Dir>.^.Backup.Script A ~C ~D F ~L ~N ~P Q ~R ~S ~T ~V"
-fileopen=
"<IRCMacroScripts$Dir>.Script"
loop=1
-loop$=
(loop):
loop<10
loop$="0"+loop$
temp$=
Readircmacro(loop-1)
tofile("IRCTag"+loop$+"="+temp$)
tofile("IRCDef"+loop$+"="+ircmacro$(loop))
#fileopen
"XOS_CLI","SetType <IRCMacroScripts$Dir>.Script FFF"
Readircmacro(icon)
!block%=ircmacrohandle
block%!4=icon
"Wimp_GetIconState",,block%
=$(block%!28)